package at.fhj.ase.business;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;

import javax.xml.stream.XMLStreamException;

import org.junit.Before;
import org.junit.Test;

import at.fhj.ase.data.AttackOutput;

public class TestOutputGenerator {

	AttackDetector detector;
	
	@Before
	public void setup() throws FileNotFoundException, XMLStreamException, IOException{
		FilterParser parser = new FilterParser();
		this.detector = new AttackDetector(parser.extractFilters(parser.createFilterFileParser()));

	}
	
	@Test
	public void testReportToXHTML() throws IOException, XMLStreamException{
		List<AttackOutput> detectedAttacks = detector.readAccessLogFile("resources/accesslog.txt");
		OutputGenerator.reportToXHTML(detectedAttacks, "finalReport.xhtml");
	}
}
